package com.sgb.kjwl.view.ui.adapter.manage;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import androidx.core.util.Pair;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.manage.EpAssestEntity;
import com.sgb.kjwl.utils.ActivityJump;
import com.sgb.kjwl.view.ui.activity.manage.ShopInfoForCompanyTradesActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteInfoActivity;
import com.sgb.kjwl.view.ui.activity.self.shop.ShopInfoActivity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class EpAssetAdapter extends BaseRecycleAdapter<EpAssestEntity> {
    private Context context;

    public EpAssetAdapter(Context context, List<EpAssestEntity> datas) {
        super(context, R.layout.item_ep_assest, datas);
        this.context = context;
    }

    @Override
    public void convert(ItemViewHolder holder, EpAssestEntity epAssestEntity) {
        holder.setBinding(BR.viewModel, epAssestEntity);

        holder.getItem().findViewById(R.id.btn_enter_enterprise).setOnClickListener(view -> WebsiteInfoActivity.start(context,epAssestEntity.getCompanyNo(),1));
        holder.getItem().findViewById(R.id.company_name).setOnClickListener(view -> WebsiteInfoActivity.start(context,epAssestEntity.getCompanyNo(),1));
    }

}
